package com.imooc.pan.storage.engine.core;

import com.imooc.pan.storage.engine.core.context.*;

import java.io.IOException;

/**
 * 文件存储引擎的顶级接口
 */
public interface StorageEngine {

    /**
     * 上传文件
     * @param context
     */
    void store(StoreFileContext context) throws IOException;

    /**
     * 删除文件
     * @param context
     */
    void delete(DeleteFileContext context) throws IOException;


    /**
     * 上传文件分片
     */
    void storeChunkFile(StoreChunkFileContext context) throws IOException;

    /**
     * 文件合并
     * @param context
     * @throws IOException
     */
    void mergeFile(MergeFileContext context) throws IOException;

    /**
     * 文件下载
     * @param context
     * @throws IOException
     */
    void readFile(ReadFileContext context) throws IOException;
}
